from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import render

from moments.models import Status


# Create your views here.
def home(request):
    # 将请求和模版组合后返回
    return render(request, "homepage.html")
# todo 实现相应模版的展现
@login_required
def show_user(request):
    context = {
        'user': {
            'name': 'xiao po',
            'motto': 'i love kungfu',
            'email': 'po@disney.com',
            'region': 'chengdu',
            'pic': 'Po2.jpg',
        }
    }
    return render(request, "user.html", context)
@login_required
def show_status(request):
    statuses = Status.objects.all()
    context = {
        'statuses': statuses
    }
    return render(request, "status.html", context)
@login_required
def show_post(request):
    return render(request, "my_post.html")